﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Menu.aspx.cs" Inherits="ValuationClient.系统管理.Menu" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <link href="../jquery-easyui-1.5.2/themes/default/easyui.css" rel="stylesheet" />
    <link href="../jquery-easyui-1.5.2/themes/icon.css" rel="stylesheet" />
    <link href="../jquery-easyui-1.5.2/demo/demo.css" rel="stylesheet" />
    <script src="../js/jquery-1.8.2.min.js"></script>
    <script src="../jquery-easyui-1.5.2/jquery.easyui.min.js"></script>
    <script src="../jquery-easyui-1.5.2/easyloader.js"></script>
    <script src="../js/jquery.params.js"></script>
</head>
<body>
    
    <!---- 查询权限信息---->
    <div id="tb">
        <span>权限名称：</span>
        <input class="easyui-textbox" id="authority_Name" data-options="prompt:'请输入权限名称'" style="width: 30%; height: 27px">
        <a href="#" class="easyui-linkbutton" plain="true" data-options="iconCls:'icon-search'" onclick="GetSysAuthority()" style="width: 80px; margin-bottom: 2px; margin-left: 10px; border: solid 1px #c0f6ef">查询</a>
    </div>

    <!---- 显示权限信息---->
   <%-- <div style="width: 35%; height: 100%; margin: 10px;">--%>
      <table id="dg" class="easyui-datagrid" title="显示权限信息" url="" toolbar="#tb" rownumbers="true" pagination="true"></table>
  <%--  </div>--%>
</body>
</html>
<script>
    $(function () {
        GetSysAuthority();
    })
    ///加载权限信息
    function GetSysAuthority() {
        var name = $('#authority_Name').val();
        //var name = $.query.get("name");
        $.ajax({
            type: "get",
            url: "http://localhost:55439/api/Values/GetSysAuthority/?name=" + name,
            dataType: "json",
            success: function (obj) {
                obj = eval(obj);
                $("#dg").datagrid({
                    pagination: true,
                    data: obj.slice(0, 10),
                    striped: true,
                    columns: [[
                        { field: "authority_Id", width: 150, title: '权限编号', align: 'center', closed: true },
                        { field: "authority_Name", width: 150, title: '权限名称', align: 'center' },
                        {
                            field: "authority_Url", width: 150, title: '权限路径', align: 'center',
                            formatter: function (value, row, index) {
                                ///formatter: function (value, rec) {
                                return row.authority_Url == "" ? '暂无路径' : row.authority_Url

                            }
                        },
                    ]]
                });
                var pager = $("#dg").datagrid("getPager");
                pager.pagination({
                    beforePageText: '第',//页数文本框前显示的汉字 
                    afterPageText: '页 共 {pages} 页',
                    displayMsg: '共{total}条数据',
                    total: obj.length,
                    onSelectPage: function (pageNo, pageSize) {
                        var start = (pageNo - 1) * pageSize;
                        var end = start + pageSize;
                        $("#dg").datagrid("loadData", obj.slice(start, end));
                        pager.pagination('refresh', {
                            total: obj.length,
                            pageNumber: pageNo
                        });
                    }
                });
            }
        })
    }
</script>

